<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="css/flick/jquery-ui-1.8.18.custom.css" rel="Stylesheet" />    
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
<?php
  require_once ("conexion.php");
  $html = "";
  $sql = mysql_query("SELECT * FROM operador WHERE Tipo_Operador = 'P'");
  while($cdata = mysql_fetch_object($sql)){
    $html.= '<option value="'.$cdata->ID_Operador.'">'.$cdata->Nombre_Operador.'</option>';
  }
?>
<script>
	$(function() {
		$("#fecha").datepicker({dateFormat: 'dd/mm/yy'});
	});
</script>
<title>Selección de Proveedores</title>
</head>
<body>
<form id="pagos" name="pagos" method="post" action="pagosmasivos.php">
Fecha del Proceso:
<input type="text" name="fecha" id="fecha" value="<?php echo date('d')."/".date('m')."/".date('Y'); ?>" />
 
 <table>
  <tr>
<td>Proveedores a pagar</td><td></td>
</tr>
    <tr id="proveedores">
    <td>Proveedor</td><td size='20'>Factura</td><td size='20'>Monto</td>
    <td>
    </select><a href="javascript:;" class="agregar_proveedor">[+]</a></td></tr>
  </table>
  <script>
$(".agregar_proveedor").each(function(){
  $(this).click(function(){
    var html = '<tr><td><select name="proveedor[]" id="proveedor"><option value="">:: Seleccione ::</option>';
    html += '<?php echo $html; ?>';
    html += '</select></td><td><input type="text" name="factura[]" id="factura"></td><td><input type="text" name="monto[]" id="monto"></td><td><a href="javascript:;" class="quitar_proveedor">[-]</a></td></tr>';
    $("#proveedores").after(html);
  });
});
</script>
<input type="submit" name="enviar" value="Enviar" />
</form>
</body>